{% extends 'course-manage/layout.html.twig' %}

{% block title %}{{'course.order.content_title'|trans}} - {{ course.title }} - {{ parent() }}{% endblock %}
{% set course_side_nav = 'orders' %}
{% block main_heading_class %}course-main-header{% endblock %}

{% do script(['libs/bootstrap-datetimepicker.js', 'app/js/course-manage/order/index.js']) %}

{% block main_heading %}
  {% include 'course-manage/panel-header/course-publish-header.html.twig' with {code: course_side_nav,btnGroup:1} %}
{% endblock %}

{% block main_body %}
    <div>
      <form id="user-search-form" class="form-inline well well-sm" action="" method="get" novalidate>
        <input type="hidden" name="orderItemType" value="course">
        <input type="hidden" name="order_item_target_ids[]" value="{{ course.id }}">
        <div class="mbm">
          {{'course.order.create_time'|trans}} :
          <div class="form-group">
            <input class="form-control" type="text" id="startDate" name="startDateTime" value="{{app.request.query.get('startDateTime')}}" placeholder="{{'course.order.start_time'|trans}}">
          </div>
          <div class="form-group">-</div>
          <div class="form-group">
            <input class="form-control" type="text" id="endDate" name="endDateTime" value="{{app.request.query.get('endDateTime')}}" placeholder="{{'course.order.end_time'|trans}}">
          </div>
        </div>
        <div>
          {{'course.order.conditions'|trans}} :
          <div class="form-group">
            <select class="form-control" name="displayStatus">
              {{ select_options(dict('orderDisplayStatus'), request.get('displayStatus'), 'course.order.status'|trans) }}
            </select>
          </div>

          <div class="form-group">
            <select class="form-control" name="payment">
              {% set options = {'':'order.payment_pattern'|trans,'alipay':'order.payment_pattern.alipay'|trans,'wxpay':'order.payment_pattern.wxpay'|trans,'none':'order.payment_pattern.other'|trans} %}
              {{ select_options(options, request.get('payment')) }}
            </select>
          </div>

          <span class="divider"></span>

          <div class="form-group">
            <select class="form-control" name="keywordType">
              {% set options = {sn: 'coin.order_sn'|trans, buyer:'admin.order.buyer'|trans} %}
              {{ select_options(options, request.get('keywordType')) }}
            </select>
          </div>

          <div class="form-group">
            <input class="form-control" type="text" name="keyword" value="{{ request.get('keyword') }}" placeholder="{{'form.placeholder.keyword'|trans}}">
          </div>

          <button class="cd-btn cd-btn-primary">{{'form.btn.search'|trans}}</button>
        </div>
        <input type="hidden" name="courseId" value="{{ course.id }}">
      </form>
      <table class="table table-striped table-hover" id="order-table">
        {% include 'order/order-table.html.twig' with {mode:'course'} %}
      </table>
      {{ web_macro.paginator(paginator) }}
    </div>
{% endblock %}
